package com.tencent.smtt.sdk;

import android.content.Context;
import com.tencent.smtt.utils.TbsLog;
import java.nio.channels.FileLock;

/* loaded from: classes2.dex */
public class bt {
    private static bt a;
    private static FileLock e;
    private bu b;
    private boolean c;
    private boolean d;

    private bt() {
    }

    public static bt a() {
        if (a == null) {
            synchronized (bt.class) {
                if (a == null) {
                    a = new bt();
                }
            }
        }
        return a;
    }

    public bu a(boolean z) {
        return z ? this.b : c();
    }

    /* JADX WARN: Removed duplicated region for block: B:115:0x019e A[Catch: all -> 0x01c1, TryCatch #3 {, blocks: (B:68:0x0001, B:71:0x0023, B:73:0x0027, B:82:0x005f, B:84:0x0063, B:87:0x007a, B:89:0x0096, B:105:0x0109, B:107:0x0115, B:108:0x0135, B:118:0x01bd, B:109:0x013a, B:110:0x015b, B:112:0x0161, B:113:0x017d, B:114:0x0181, B:115:0x019e, B:117:0x01ba, B:79:0x0041, B:80:0x005c, B:85:0x0072, B:93:0x00a7, B:95:0x00ad, B:96:0x00b9, B:98:0x00bd, B:99:0x00ec, B:101:0x00f0, B:74:0x0032, B:76:0x003a), top: B:128:0x0001 }] */
    /* JADX WARN: Removed duplicated region for block: B:89:0x0096 A[Catch: all -> 0x01c1, TRY_LEAVE, TryCatch #3 {, blocks: (B:68:0x0001, B:71:0x0023, B:73:0x0027, B:82:0x005f, B:84:0x0063, B:87:0x007a, B:89:0x0096, B:105:0x0109, B:107:0x0115, B:108:0x0135, B:118:0x01bd, B:109:0x013a, B:110:0x015b, B:112:0x0161, B:113:0x017d, B:114:0x0181, B:115:0x019e, B:117:0x01ba, B:79:0x0041, B:80:0x005c, B:85:0x0072, B:93:0x00a7, B:95:0x00ad, B:96:0x00b9, B:98:0x00bd, B:99:0x00ec, B:101:0x00f0, B:74:0x0032, B:76:0x003a), top: B:128:0x0001 }] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    public synchronized void a(android.content.Context r11) {
        /*
            Method dump skipped, instructions count: 454
            To view this dump change 'Code comments level' option to 'DEBUG'
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.smtt.sdk.bt.a(android.content.Context):void");
    }

    public synchronized FileLock b(Context context) {
        String str;
        String str2;
        TbsLog.i("X5CoreEngine", "tryTbsCoreLoadFileLock ##");
        FileLock fileLock = e;
        if (fileLock != null) {
            return fileLock;
        }
        FileLock e2 = com.tencent.smtt.utils.j.e(context);
        e = e2;
        if (e2 == null) {
            str = "X5CoreEngine";
            str2 = "init -- sTbsCoreLoadFileLock failed!";
        } else {
            str = "X5CoreEngine";
            str2 = "init -- sTbsCoreLoadFileLock succeeded!";
        }
        TbsLog.i(str, str2);
        return e;
    }

    public boolean b() {
        if (QbSdk.a) {
            return false;
        }
        return this.c;
    }

    public bu c() {
        if (QbSdk.a) {
            return null;
        }
        return this.b;
    }

    public void c(Context context) {
        boolean z;
        FileLock fileLock;
        try {
            z = TbsDownloadConfig.getInstance().getTbsCoreLoadRenameFileLockEnable();
        } catch (Throwable unused) {
            z = true;
        }
        if (z && (fileLock = e) != null) {
            com.tencent.smtt.utils.j.a(context, fileLock);
        }
    }

    public boolean d() {
        return this.d;
    }
}
